package com.acme.bankapp.domine.bank;

public class Client {
    private static final int MAX_COUNT_ACCOUNT = 10;
    private Gender gender;
    private String name;
    private Account[] accounts;

    public int getCountAccount() {
        return countAccount;
    }

    private int countAccount;

    public Account[] getAccounts() {
        return accounts;
    }

    public Client(final String name, final Gender gender) {
        accounts = new Account[MAX_COUNT_ACCOUNT];
        this.name = name;
        this.gender = gender;
    }

    public String getClientSalutation() {
        return gender.toString() + " " + name;
    }

    public void addAccount(final Account account) {
        if (countAccount < MAX_COUNT_ACCOUNT) {
            accounts[countAccount++] = account;
        } else {
            System.out.println("Storage of accounts filled completely");
        }
    }
}
